package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.entity.QuLeaderInfo;
import com.pj.wisdomlogistics.mvp.contract.QuLeaderContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.QuLeaderModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;

import java.util.List;


public class QuLeaderPresenter extends ActivityPresenter<QuLeaderModel, QuLeaderContract.View> implements QuLeaderContract.Presenter {
    public static final String TAG = "QuLeaderPresenter";

    @Override
    public void checkLeader() {
        addSubscription(getModel().checkLeader(), new FilterSubscriber<List<QuLeaderInfo>>() {
            @Override
            public void onNext(List<QuLeaderInfo> mInfos) {
                getView().onSuccess(mInfos);
            }

            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().onError(errorMsg);
            }

        });
    }
}
